<?

$TIME = $TASK->getRelated('time');

$D = new CDateFormatter('ru');

$alltime = 0; $his = '<ol>';
foreach($TIME as $T){
    $USER = $T->getRelated('time_user');
    $time = $T->time_end - $T->time_start - $T->time_break;
    $alltime += $time;
    $his .= '<li class="histrow">'.$USER->GetLink().' '.TaskTime::timeFormat($time).' <small>('.$D->formatDateTime($T->time_start, 'long', 'short').')</small></li>';
}
$his .= '</ol>';

if($alltime > 0){
?>
<ul class="col-history">
    <li class="summary">
        <a href="#" onclick="$('#time-history-<?=$TASK->id?>').toggle();return false;">
        Уже затрачено времени: <?=TaskTime::timeFormat($alltime)?>
        </a>
    </li>
    <li class="more hide" id="time-history-<?=$TASK->id?>"><?=$his?></li>
</ul>
<?}?>
